package com.itheima.sc.service.order;

import com.itheima.sc.api.order.OmsOrderSettingApi;
import com.itheima.sc.pojo.order.OmsCompanyAddress;
import com.itheima.sc.pojo.order.OmsOrderSetting;
import com.itheima.sc.result.Result;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OmsOrderSettingService {

    @DubboReference
    OmsOrderSettingApi omsOrderSettingApi;
    public Result getById(Long id) {
        OmsOrderSetting omsOrderSetting = omsOrderSettingApi.getSettingById(id);
        return Result.success(omsOrderSetting);
    }

    public void updateSetting(Long id, OmsOrderSetting omsOrderSetting) {
        omsOrderSettingApi.updateSetting(id,omsOrderSetting);
    }

    public Result getAddress() {
        List<OmsCompanyAddress>list=omsOrderSettingApi.getAddress();
        return Result.success(list);
    }
}
